//
//  MainViewController.m
//  DimComDemo
//
//  Created by 于跃隆 on 2019/1/23.
//  Copyright © 2019 于跃隆. All rights reserved.
//

#import "MainViewController.h"
#import "HomePViewController.h" //首页
#import "ShopViewController.h" //购物
#import "CircleViewController.h" // 圈子
#import "MyViewController.h" //我的
#import "OrderFViewController.h" //订单

@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewWillLayoutSubviews{
    CGRect tabFrame = self.tabBar.frame; //self.TabBar is IBOutlet of your TabBar
    tabFrame.size.height = 65;
    tabFrame.origin.y = self.view.frame.size.height - 65;
    self.tabBar.frame = tabFrame;
    self.navigationController.navigationBar.hidden=YES;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    //首页界面
    UINavigationController *HomeP = [[UINavigationController alloc] initWithRootViewController:[[HomePViewController alloc] init]];
    //设置点击前图片和点击后图片
    HomeP.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[UIImage imageNamed:@"common_tab_btn_home_n_hdpi"] selectedImage:[UIImage imageNamed:@"common_tab_btn_home_s"]];
    
    //圈子界面
    UINavigationController *Circle = [[UINavigationController alloc] initWithRootViewController:[[CircleViewController alloc] init]];
    //设置点击前图片和点击后图片
    Circle.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[UIImage imageNamed:@"common_tab_btn_circle_n_hdpi"] selectedImage:[UIImage imageNamed:@"common_tab_btn_circle_s_hdpi"]];
    
    
    //购物界面
    UINavigationController *Shop = [[UINavigationController alloc] initWithRootViewController:[[ShopViewController alloc] init]];
    //设置点击前图片和点击后图片
    Shop.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[UIImage imageNamed:@"commom_tab_btn_shopping cart_n_hdpi"] selectedImage:[UIImage imageNamed:@"commom_tab_btn_shopping cart_n_hdpi"]];
    
    //订单界面
    UINavigationController *OrderF = [[UINavigationController alloc] initWithRootViewController:[[OrderFViewController alloc] init]];
    //设置点击前图片和点击后图片
    OrderF.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[UIImage imageNamed:@"common_tab_btn_list_n_hdpi"] selectedImage:[UIImage imageNamed:@"common_tab_btn_list_s_hdpi"]];
    
    //我的界面
    UINavigationController *My = [[UINavigationController alloc] initWithRootViewController:[[MyViewController alloc] init]];
    //设置点击前图片和点击后图片
    My.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[UIImage imageNamed:@"common_tab_btn_my_n_hdpi"] selectedImage:[UIImage imageNamed:@"common_tab_btn_my_s_hdpi"]];
    
    
    //添加tabbar
    [self setViewControllers:@[HomeP,Circle,Shop,OrderF,My]];
    
}


@end
